package com.crazymaker.springcloud.demo.controller;

import com.crazymaker.springcloud.demo.api.DemoApi;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api("演示zuul远程调用")
public class ZuulTestController {

    @Autowired
    private DemoApi demoApi;

    @GetMapping("/api/zuulfilter/demo")
    @ApiOperation(value = "zuul远程调用")
    public ResponseEntity<Object> getUser(@RequestParam(value = "username", required = true) String username) {
        return demoApi.blackTest(username);
    }

}
